package oop;

import java.util.Arrays;
import java.util.Objects;

/**
 * Author: hu
 * Date: 2021/12/20 11:33
 */
public class JvmDemo {

    int id;
    String name;
    String addr;

    public static void main(String[] args) {
        Integer i1 = 100;
        Integer i2 = 100;
        Integer i3 = 200;
        Integer i4 = 200;
        System.out.println(i1==i2);
        System.out.println(i3==i4);

        int a = 10;
        long b = 10L;
        double c = 10.0;
        System.out.println(a==b);
        System.out.println(b==c);
        System.out.println(a==c);

    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof JvmDemo)) return false;
        JvmDemo jvmDemo = (JvmDemo) o;
        return id == jvmDemo.id && name.equals(jvmDemo.name) && addr.equals(jvmDemo.addr);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, addr);
    }
}
